package net.guerlab.smart.platform.user.internal.controller.inside;

import io.swagger.annotations.Api;
import net.guerlab.smart.platform.user.core.domain.OperationLogDTO;
import net.guerlab.smart.platform.user.service.entity.OperationLog;
import net.guerlab.smart.platform.user.service.service.OperationLogService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 操作日志
 *
 * @author guer
 */
@Api(tags = "操作日志")
@RestController("/inside/operationLog")
@RequestMapping("/inside/operationLog")
public class OperationLogController {

    private OperationLogService service;

    @PostMapping("/add")
    public void add(@RequestBody OperationLogDTO dto) {
        OperationLog log = new OperationLog();
        BeanUtils.copyProperties(dto, log);
        service.add(log);
    }

    @Autowired
    public void setService(OperationLogService service) {
        this.service = service;
    }
}
